﻿<!DOCTYPE HTML>
<html>

<head>
	<!-- <link rel="stylesheet" type="text/css" href="/static/admin/css/H-ui.min.css" /> -->
	<link rel="stylesheet" type="text/css" href="/static/admin/css/H-ui.admin.css" />
	<link rel="stylesheet" type="text/css" href="/static/admin/lib/Hui-iconfont/1.0.8/iconfont.css" />
	<link rel="stylesheet" type="text/css" href="/static/admin/skin/default/skin.css" id="skin" />
	<link rel="stylesheet" type="text/css" href="/static/admin/css/style.css" />

	<link href="/static/admin/lib/lightbox2/2.8.1/css/lightbox.css" rel="stylesheet" type="text/css">

	<style>
		.portfolio-content li.item{
			list-style-type:none;
		}
	</style>
</head>

<body>

	<div class="pd-20">
		<div class="cl pd-5 bg-1 bk-gray mt-20">
			<span class="l">
				<a href="/admin/pictures/showadd?cid={$map.cid}&sid={$map.sid}" class="btn btn-primary radius">
					<i class="Hui-iconfont">&#xe600;</i> 添加</a>
				<a href="javascript:;" onclick="del_all('pictures')" class="btn btn-danger radius">
					<i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a>
			</span>
		</div>
		<div class="portfolio-content">
			<ul class="cl portfolio-area">
				{foreach $data as $val}
				<li class="item">
					<div class="portfoliobox">
						<input class="checkbox" name="checkbox[]" type="checkbox" value="{$val.id}">
						<div class="picbox">
							<a href="{$val.image}" data-lightbox="gallery">
								<img src="{$val.thumb}">
							</a>
						</div>
						<div class="textbox"></div>
					</div>
				</li>
				{/foreach}
			</ul>
		</div>
	</div>
	<!--_footer 作为公共模版分离出去-->
	<script type="text/javascript" src="/static/admin/lib/jquery/1.9.1/jquery.min.js"></script>
	<script type="text/javascript" src="/static/admin/lib/layer/2.4/layer.js"></script>
	<script type="text/javascript" src="/static/admin/js/H-ui.js"></script>
	<script type="text/javascript" src="/static/admin/js/H-ui.admin.page.js"></script>
	<!--/_footer /作为公共模版分离出去-->

	<!--请在下方写此页面业务相关的脚本-->
	<script type="text/javascript">
		//字符串为空
		function isNull(str) {
			if (str == null || str == "" || str.length < 1)
				return true;
			else
				return false;
		}

		function del_all(controller) {
			if (isNull(controller)) {
				url = 'del';
			} else {
				url = '/admin/' + controller + '/del';
			}
			var checkbox = $('input[name="checkbox[]"]');
			var ids = new Array();
			checkbox.each(function (x) {
				if (this.checked)
					ids.push(this.value);
			})

			var length = ids.length;

			if (length == 0) {
				layer.msg('请选择要删除的选项', {
					icon: 5,
					time: 1000
				});
				return false;
			}

			layer.confirm('确认要删除选中项吗？', function (index) {
				$.post(url, {
					'id': ids
				}, function (data) {
					if (data.code == 2) {
						checkbox.each(function (x) {
							if (this.checked)
								$(this).parents("li").remove();
						})
						layer.msg(data.msg, {
							icon: 1,
							time: 1000
						});
					} else {
						layer.msg(data.msg, {
							icon: 5,
							time: 2000
						});
						return false;
					}
				}, 'json');
			});
		}
	</script>
</body>

</html>